from flask import Flask
from blueprint import api
from mqtt.mqtt_module import setup_mqtt

app = Flask(__name__)
app.json.ensure_ascii = False
try:
    data_list = setup_mqtt(app)
    app.config['DATA_LIST'] = data_list
except Exception as e:
    data_list = []
    app.config['DATA_LIST'] = data_list
# 注册蓝图
app.register_blueprint(api.blueprint) 


if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True, port=5000)